package cn.ejiajunxy.manager.api;

import cn.ejiajunxy.manager.model.MoneyModel;
import cn.ejiajunxy.manager.model.MyOrderModel;
import cn.ejiajunxy.manager.model.OrderModel;
import cn.ejiajunxy.manager.model.StatusModel;
import cn.ejiajunxy.manager.model.TokenModel;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by zhangguobao on 2018/2/7.
 */

public interface ApiService {

    @FormUrlEncoded
    @POST("Order/UpdateOrderStatus")
    Observable<StatusModel> updateStatus(@Field("access_token") String access_token, @Field("orderId") String orderId, @Field("orderStatus") String orderStatus);

    @FormUrlEncoded
    @POST("Oauth2/Access_token")
    Observable<TokenModel> getToken(@Field("grant_type") String grant_type, @Field("account") String account, @Field("password") String password);

    @FormUrlEncoded
    @POST("Order/GetSchoolLeadList")
    Observable<OrderModel> getOrder(@Field("access_token") String access_token, @Field("orderStatus") String orderStatus);

    @FormUrlEncoded
    @POST("Order/AddCashApply")
    Observable<StatusModel> addCash(@Field("access_token") String access_token, @Field("alipay") String alipay, @Field("money") String money);

    @GET("Order/GetSchoolLeadFinance")
    Observable<MoneyModel> getMoney(@Query("access_token") String access_token);

    @FormUrlEncoded
    @POST("Order/GetSchoolLeadTradeList")
    Observable<MyOrderModel> getMyOrder(@Field("access_token") String access_token, @Field("pageIndex") int pageIndex, @Field("pageSize") int pageSize);
}

